package com.tech.dcyao.service;

import com.tech.dcyao.Iservice.HttpService;
import com.tech.dcyao.utils.HttpClientWrapper;
import org.springframework.stereotype.Service;

import java.io.IOException;

@Service
public class HttpClientService implements HttpService {
    private final HttpClientWrapper httpClientWrapper;
    public HttpClientService() {
        this.httpClientWrapper = new HttpClientWrapper();
    }
    @Override
    public String sendPostRequest(String url, String json) throws IOException {
        return httpClientWrapper.sendPostRequest(url, json);
    }

    @Override
    public String getRequest(String url) throws IOException {
        return httpClientWrapper.getRequest(url);
    }

    @Override
    public void setBaseUrl(String url) {
        httpClientWrapper.setBaseUrl(url);
    }

    @Override
    public String getBaseUrl() {
        return httpClientWrapper.getBaseUrl();
    }

}
